﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace MingYuanYun.Context.Abstractions
{
    /// <summary>
    /// The api context of Diagnose Expert Platform.
    /// </summary>
    public interface IServiceContext
    {
        /// <summary>
        /// The configuration which defined in json file.
        /// </summary>
        IConfiguration Configuration { get; }

        /// <summary>
        /// The service provider which can get the registered service in startup.
        /// </summary>
        IServiceProvider ServiceProvider { get; }

        /// <summary>
        /// Since .net core will manage the service lifecylce, when in the background thread, we have to manage the scope manually.
        /// </summary>
        IServiceScopeFactory ServiceScopeFactory { get; }
    }
}
